#include "planetmodels.h"


Planetmodels::Planetmodels()
{
	
}
Planetmodels::~Planetmodels()
{
}
bool Planetmodels::initialize(HWND hwnd, D3DClass* m_D3D) {
	m_modelCount = 18;
	models = new ModelClass[m_modelCount];
	bool result;
	result = models[0].Initialize(m_D3D->GetDevice(), L"../Engine/data/earth.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[1].Initialize(m_D3D->GetDevice(), L"../Engine/data/jupiter.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[2].Initialize(m_D3D->GetDevice(), L"../Engine/data/mars.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[3].Initialize(m_D3D->GetDevice(), L"../Engine/data/merkur.jpg", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[4].Initialize(m_D3D->GetDevice(), L"../Engine/data/moon.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[5].Initialize(m_D3D->GetDevice(), L"../Engine/data/neptune.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[6].Initialize(m_D3D->GetDevice(), L"../Engine/data/saturn.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[7].Initialize(m_D3D->GetDevice(), L"../Engine/data/uranus.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[8].Initialize(m_D3D->GetDevice(), L"../Engine/data/venus.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[9].Initialize(m_D3D->GetDevice(), L"../Engine/data/planet01.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[10].Initialize(m_D3D->GetDevice(), L"../Engine/data/planet01.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[11].Initialize(m_D3D->GetDevice(), L"../Engine/data/planet02.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[12].Initialize(m_D3D->GetDevice(), L"../Engine/data/planet03.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[13].Initialize(m_D3D->GetDevice(), L"../Engine/data/planet04.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[14].Initialize(m_D3D->GetDevice(), L"../Engine/data/planet05.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[15].Initialize(m_D3D->GetDevice(), L"../Engine/data/planet06.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[16].Initialize(m_D3D->GetDevice(), L"../Engine/data/planet07.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	result = models[17].Initialize(m_D3D->GetDevice(), L"../Engine/data/planet08.png", "../Engine/data/sphere.txt");
	if(!result)
	{
		MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
		return false;
	}
	return true;
}
ModelClass* Planetmodels::getModel(int i) {
	if(i >= m_modelCount)
		return 0;
	return &models[i];
}
int Planetmodels::getModelcount() {
	return m_modelCount;
}
